package org.hxyjs.entity;

import org.hxyjs.service.AccountService;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author 
 */
public class Salesagent implements Serializable,Account {
    private String sano;

    private String prno;

    private String saimg;

    private String saname;

    private String sasex;

    private String saage;

    private String saphone;

    private String said;

    private String sapwd;

    private String sadescribe;

    private Integer sastate;

    private String saemail;

    String salt;//加密用的盐

    Integer isDelete;

    Date createDate;

    List<AccountRole> accountRoles;


    private static final long serialVersionUID = 1L;

    public String getSalt() {
        return salt;
    }

    @Override
    public Boolean getLocked() {
        return null;
    }

    @Override
    public String getCredentialsSalt() {
        return getAccountname() + salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    @Override
    public String getAccountid() {
        return sano;
    }

    @Override
    public String getAccountname() {
        return saname;
    }

    @Override
    public String getPassword() {
        return sapwd;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public List<AccountRole> getAccountRoles() {
        return accountRoles;
    }

    public void setAccountRoles(List<AccountRole> accountRoles) {
        this.accountRoles = accountRoles;
    }

    public String getSano() {
        return sano;
    }

    public void setSano(String sano) {
        this.sano = sano;
    }

    public String getPrno() {
        return prno;
    }

    public void setPrno(String prno) {
        this.prno = prno;
    }

    public String getSaimg() {
        return saimg;
    }

    public void setSaimg(String saimg) {
        this.saimg = saimg;
    }

    public String getSaname() {
        return saname;
    }

    public void setSaname(String saname) {
        this.saname = saname;
    }

    public String getSasex() {
        return sasex;
    }

    public void setSasex(String sasex) {
        this.sasex = sasex;
    }

    public String getSaage() {
        return saage;
    }

    public void setSaage(String saage) {
        this.saage = saage;
    }

    public String getSaphone() {
        return saphone;
    }

    public void setSaphone(String saphone) {
        this.saphone = saphone;
    }

    public String getSaid() {
        return said;
    }

    public void setSaid(String said) {
        this.said = said;
    }

    public String getSapwd() {
        return sapwd;
    }

    public void setSapwd(String sapwd) {
        this.sapwd = sapwd;
    }

    public String getSadescribe() {
        return sadescribe;
    }

    public void setSadescribe(String sadescribe) {
        this.sadescribe = sadescribe;
    }

    public Integer getSastate() {
        return sastate;
    }

    public void setSastate(Integer sastate) {
        this.sastate = sastate;
    }

    public String getSaemail() {
        return saemail;
    }

    public void setSaemail(String saemail) {
        this.saemail = saemail;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Salesagent other = (Salesagent) that;
        return (this.getSano() == null ? other.getSano() == null : this.getSano().equals(other.getSano()))
            && (this.getPrno() == null ? other.getPrno() == null : this.getPrno().equals(other.getPrno()))
            && (this.getSaimg() == null ? other.getSaimg() == null : this.getSaimg().equals(other.getSaimg()))
            && (this.getSaname() == null ? other.getSaname() == null : this.getSaname().equals(other.getSaname()))
            && (this.getSasex() == null ? other.getSasex() == null : this.getSasex().equals(other.getSasex()))
            && (this.getSaage() == null ? other.getSaage() == null : this.getSaage().equals(other.getSaage()))
            && (this.getSaphone() == null ? other.getSaphone() == null : this.getSaphone().equals(other.getSaphone()))
            && (this.getSaid() == null ? other.getSaid() == null : this.getSaid().equals(other.getSaid()))
            && (this.getSapwd() == null ? other.getSapwd() == null : this.getSapwd().equals(other.getSapwd()))
            && (this.getSadescribe() == null ? other.getSadescribe() == null : this.getSadescribe().equals(other.getSadescribe()))
            && (this.getSastate() == null ? other.getSastate() == null : this.getSastate().equals(other.getSastate()))
            && (this.getSaemail() == null ? other.getSaemail() == null : this.getSaemail().equals(other.getSaemail()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSano() == null) ? 0 : getSano().hashCode());
        result = prime * result + ((getPrno() == null) ? 0 : getPrno().hashCode());
        result = prime * result + ((getSaimg() == null) ? 0 : getSaimg().hashCode());
        result = prime * result + ((getSaname() == null) ? 0 : getSaname().hashCode());
        result = prime * result + ((getSasex() == null) ? 0 : getSasex().hashCode());
        result = prime * result + ((getSaage() == null) ? 0 : getSaage().hashCode());
        result = prime * result + ((getSaphone() == null) ? 0 : getSaphone().hashCode());
        result = prime * result + ((getSaid() == null) ? 0 : getSaid().hashCode());
        result = prime * result + ((getSapwd() == null) ? 0 : getSapwd().hashCode());
        result = prime * result + ((getSadescribe() == null) ? 0 : getSadescribe().hashCode());
        result = prime * result + ((getSastate() == null) ? 0 : getSastate().hashCode());
        result = prime * result + ((getSaemail() == null) ? 0 : getSaemail().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", sano=").append(sano);
        sb.append(", prno=").append(prno);
        sb.append(", saimg=").append(saimg);
        sb.append(", saname=").append(saname);
        sb.append(", sasex=").append(sasex);
        sb.append(", saage=").append(saage);
        sb.append(", saphone=").append(saphone);
        sb.append(", said=").append(said);
        sb.append(", sapwd=").append(sapwd);
        sb.append(", sadescribe=").append(sadescribe);
        sb.append(", sastate=").append(sastate);
        sb.append(", saemail=").append(saemail);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }


}